import request from '@/utils/request'

//下载校验次数方法
export function checkDownloadCount(productsId, downloadType) {
  return request({
    url: '/products/download/check/downloadCount',
    method: 'get',
    params: { productsId, downloadType }
  })
}
//查询当前用户下载次数  userCount 已经下载次数  ，今日可下载次数 downloadCount
export function getDownloadCount() {
  return request({
    url: '/products/download/select/downloadCount',
    method: 'get'
  })
}


// 查询下载记录列表
export function listDownload(query) {
  return request({
    url: '/products/download/list',
    method: 'get',
    params: query
  })
}

// 查询下载记录详细
export function getDownload(id) {
  return request({
    url: '/products/download/' + id,
    method: 'get'
  })
}

// 新增下载记录
export function addDownload(data) {
  return request({
    url: '/products/download',
    method: 'post',
    data: data
  })
}

// 修改下载记录
export function updateDownload(data) {
  return request({
    url: '/products/download',
    method: 'put',
    data: data
  })
}

// 删除下载记录
export function delDownload(id) {
  return request({
    url: '/products/download/' + id,
    method: 'delete'
  })
}
